package com.neutech.controller;

import com.neutech.mapper.MenuMapper;
import com.neutech.service.DisposalService;
import com.neutech.service.DoctorService;
import com.neutech.service.MenuService;
import com.neutech.mapper.ListMapper;
import com.neutech.mapper.DisposalMapper;
import com.neutech.service.ListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;

import com.neutech.vo.*;
@CrossOrigin
@RestController
public class ListController {
    @Autowired
    private ListService listService;
    @RequestMapping("/queryList")
    public List<Map<String,Object>> getList(){
        return listService.queryList();
    }
    @RequestMapping("/insertList")
    public void insList(@RequestParam Map  map){
        listService.insertList(map);
        System.out.println(map);
    }
    @RequestMapping("/deleteList")
    public void delList(@RequestParam Map  map){

        System.out.println(map);
        listService.deleteList(map);
    }
    @RequestMapping("/updataList")
    public void updList(@RequestParam Map  map){
//        System.out.println("看这里");
//        System.out.println(map);
//        System.out.println("看这里");
        Map<String,Object> map2 = new HashMap<>();
        map2.put("rid",map.get("rid"));
        map2.put("name",map.get("name"));
        map2.put("depid",map.get("depid"));
        map2.put("account",map.get("account"));
        map2.put("password",map.get("password"));
        map2.put("level",map.get("level"));
        map2.put("quota",map.get("quota"));
        map2.put("fees",map.get("fees"));
        listService.updataList(map2);
    }
}
